package unit4.part12.taitanzues;

public class Main {
    public static void main(String[] args) {
        God taiTan = new God("TaiTan", 700, 100);
        God zeus = new God("Zeus", 1000, 70);
        God[] gods = {zeus, taiTan};
        while (true) {
            // 前者 攻击 后者
            gods[1].hurt(gods[0].attack());
            if (gods[1].isDead()) {// 死亡判定
                System.out.println(gods[0].getName() + " win. last blood:" + gods[0].getBlood());
                break;
            }
            // 交换
            God tmp = gods[0];
            gods[0] = gods[1];
            gods[1] = tmp;
        }
    }
}